package com.kingcore.director.setting.ui;

import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;
import java.io.File;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.ArrayList;
import java.util.List;

import javax.swing.ButtonGroup;
import javax.swing.JButton;
import javax.swing.JCheckBox;
import javax.swing.JComboBox;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JRadioButton;
import javax.swing.JTextField;

import org.apache.log4j.Logger;

import wzw.beans.DbBean;
import wzw.sql.DatabaseOperator;
import wzw.util.ComponentUtil;
import wzw.util.DbUtils;

import com.kingcore.director.DirectorConstants;
import com.kingcore.director.DirectorContext;
import com.kingcore.director.core.dao.DirectorCoreDao;
import com.kingcore.director.core.dao.impl.DirectorCoreDaoImpl;
import com.kingcore.director.main.MainFrame;
import com.kingcore.director.main.SystemHotKey;
import com.kingcore.framework.context.ApplicationContext;
import com.sunking.swing.JDirChooser;

public class GeneralPanel extends JPanel  implements DatabaseOperator, KeyListener{

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private JLabel jLabel = null;
	private JLabel lbl_width = null;
	private JLabel openMainFrameShortcut_title = null;
	private JLabel openMiniWindowShortcut_title = null;
	private JLabel openMainFrameShortcut_note = null;
	private JLabel openMiniWindowShortcut_note = null;
	private JLabel lbl_height = null;
	private JLabel lbl_w_h_note = null;
	private JLabel lbl_defaultOpenPanel = null;
	private JLabel lbl_defaultSearcher = null;
	private JTextField userDataPath = null;
	private JButton btnUserDataPathSelect = null;
	private JComboBox allPanelsList = null;

	Logger log = Logger.getLogger( GeneralPanel.class );
	private JCheckBox isAwokeCloseEnabled;
	private JCheckBox isMinimizeFrameAfterOpenFileOrFolder;
	
	/**
	 * This method initializes jTextField	
	 * 	
	 * @return javax.swing.JTextField	
	 */
	private JTextField getUserDataPath() {
		if (userDataPath == null) {
			userDataPath = new JTextField();
			userDataPath.setBounds(new java.awt.Rectangle(113,32,236,23));
		}
		return userDataPath;
	}

	/**
	 * This method initializes jButton	
	 * 	
	 * @return javax.swing.JButton	
	 */
	private JButton getBtnUserDataPathSelect() {
		if (btnUserDataPathSelect == null) {
			btnUserDataPathSelect = new JButton();
			btnUserDataPathSelect.setBounds(new java.awt.Rectangle(352,33,33,21));
			btnUserDataPathSelect.setText("...");
			btnUserDataPathSelect.addActionListener(new java.awt.event.ActionListener() {
				public void actionPerformed(java.awt.event.ActionEvent e) {

			        File f = JDirChooser.showDialog( userDataPath.getParent(), "Please Select directory", true, null,
			                                        "Please Select");
			        if(f != null){
			        	String ts_path=f.getAbsolutePath();
			    		if(!ts_path.endsWith(File.separator))
			    			ts_path += File.separator;			//最好以文件分隔符结尾
			        	userDataPath.setText( ts_path );
			        }
				}
			});
		}
		return btnUserDataPathSelect;
	}

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub

	}

	private MainFrame mainFrame = null;
	/**
	 * This is the default constructor
	 * @param mainFrame 
	 */
	public GeneralPanel(MainFrame mainFrame) {
		super();
		this.mainFrame = mainFrame;
		initialize();
	}

	/**
	 * This method initializes this
	 * 
	 * @return void
	 */
	private void initialize() {
		jLabel = new JLabel();
		jLabel.setBounds(new java.awt.Rectangle(20,32,84,23));
		jLabel.setText("用户数据路径");
		this.setLayout(null);
		this.setSize(428, 338);
		this.add(jLabel, null);
		this.add(getUserDataPath(), null);
		this.add(getBtnUserDataPathSelect(), null);
		
		lbl_width = new JLabel();
		lbl_width.setBounds(new java.awt.Rectangle(20,60,84,23));
		lbl_width.setText("主窗口宽度：");
		this.add(lbl_width, null);
		lbl_height = new JLabel();
		lbl_height.setBounds(new java.awt.Rectangle(160,60,40,23));
		lbl_height.setText("高度：");
		this.add(lbl_height, null);
		this.add(getMainFrameWidth(), null);
		this.add(getMainFrameHeight(), null);

		openMainFrameShortcut_title = new JLabel();
		openMainFrameShortcut_title.setBounds(new java.awt.Rectangle(20,90,120,23));
		openMainFrameShortcut_title.setText("打开主窗口快捷键：");
		this.add(openMainFrameShortcut_title, null);
		this.add(getOpenMainFrameShortcutText(), null);
		openMainFrameShortcut_note = new JLabel();
		openMainFrameShortcut_note.setBounds(new java.awt.Rectangle(267,90,150,23));
		openMainFrameShortcut_note.setText("(直接按键盘进行设置)");
		this.add(openMainFrameShortcut_note, null);
		
		openMiniWindowShortcut_title = new JLabel();
		openMiniWindowShortcut_title.setBounds(new java.awt.Rectangle(20,120,120,23));
		openMiniWindowShortcut_title.setText("打开迷你窗口快捷键:");
		this.add(openMiniWindowShortcut_title, null);
		this.add(getOpenMiniWindowShortcutText(), null);
		openMiniWindowShortcut_note = new JLabel();
		openMiniWindowShortcut_note.setBounds(new java.awt.Rectangle(267,120,150,23));
		openMiniWindowShortcut_note.setText("(直接按键盘进行设置)");
		this.add(openMiniWindowShortcut_note, null);
		
		lbl_w_h_note = new JLabel();
		lbl_w_h_note.setBounds(new java.awt.Rectangle(249,62,200,23));
		lbl_w_h_note.setText("(非正数时系统自动调整)");
		this.add(lbl_w_h_note, null);
		

		lbl_defaultOpenPanel = new JLabel();
		lbl_defaultOpenPanel.setBounds(new java.awt.Rectangle(20,150,110,23));
		lbl_defaultOpenPanel.setText("默认启动时打开：");
		this.add(lbl_defaultOpenPanel, null);
		this.add(getAllPanelsList(), null);
		
		lbl_defaultSearcher = new JLabel();
		lbl_defaultSearcher.setBounds(new java.awt.Rectangle(20,180,110,23));
		lbl_defaultSearcher.setText("默认的搜索引擎：");
		this.add(lbl_defaultSearcher, null);
		this.add(getSearchEngineList(), null);

		this.add(getAwokeConfirmCloseEnabled(), null);
		this.add(getMinimizeFrameAfterOpenFileOrFolderEnabled(), null);
		this.add(getMinedAfterStartup(), null);

		JLabel lbl_closeAction = new JLabel("关闭主面板时：");
		lbl_closeAction.setBounds(new java.awt.Rectangle(20,300,110,23));
		this.add(lbl_closeAction);
		this.add(getCloseActionAsMinimize(), null);
		this.add(getCloseActionAsClose(), null);
		
		try {
			this.fetchData();
		} catch (SQLException e) {
			e.printStackTrace();
		}
	}

	private JCheckBox mixedAfterStartup;
	private JCheckBox getMinedAfterStartup() {
		if (mixedAfterStartup == null) {
			mixedAfterStartup = new JCheckBox();
			mixedAfterStartup.setBounds(new java.awt.Rectangle(20,270,350,23));
			mixedAfterStartup.setText("启动后最小化到系统托盘");
		}
		return mixedAfterStartup;
	
	}

	public ButtonGroup closeActioGroup =null;
	public ButtonGroup getCloseActioGroup(){
		if (closeActioGroup==null) {
			closeActioGroup = new ButtonGroup();
		}
		return closeActioGroup;
	} 
	
	public JRadioButton closeActionAsMinimize;
	private JRadioButton getCloseActionAsMinimize() {
		if (closeActionAsMinimize==null) {
			closeActionAsMinimize = new JRadioButton();
			closeActionAsMinimize.setBounds(new java.awt.Rectangle(115,300,185,23));
			closeActionAsMinimize.setText("最小化到托盘，不退出程序");
			getCloseActioGroup().add(closeActionAsMinimize);
		}
		return closeActionAsMinimize;
	}

	public JRadioButton closeActionAsClose;
	private JRadioButton getCloseActionAsClose() {
		if (closeActionAsClose==null) {
			closeActionAsClose = new JRadioButton();
			closeActionAsClose.setBounds(new java.awt.Rectangle(300,300,100,23));
			closeActionAsClose.setText("退出程序");
			getCloseActioGroup().add(closeActionAsClose);
		}
		return closeActionAsClose;
	}

	private JComboBox getAllPanelsList() {
		if (allPanelsList == null) {
			allPanelsList = new JComboBox();
			allPanelsList.setBounds(new java.awt.Rectangle(122,150,180,23));
			ComponentUtil.initComboBox( allPanelsList, MainFrame.MainPanel_Codes );
			allPanelsList.setSelectedIndex(0) ;
		}
		return allPanelsList;
	}
	
	private JComboBox searchEngineList = null;
	private JComboBox getSearchEngineList() {
		if (searchEngineList == null) {
			searchEngineList = new JComboBox();
			searchEngineList.setBounds(new java.awt.Rectangle(122,180,180,23));
			ComponentUtil.initComboBox( searchEngineList, DirectorConstants.MainPanel_SearchEngines );
			searchEngineList.setSelectedIndex(0) ;
		}
		return searchEngineList;
	} 
	
	
	private JTextField mainFrameWidth = null;
	private JTextField getMainFrameWidth() {
		if (mainFrameWidth==null) {
			mainFrameWidth = new JTextField();
			mainFrameWidth.setBounds(new java.awt.Rectangle(100,60,45,23));
		}
		return mainFrameWidth;
	}

	private JTextField penMainFrameShortcutText = null;
	private JTextField getOpenMainFrameShortcutText() {
		if (penMainFrameShortcutText==null) {
			penMainFrameShortcutText = new JTextField();
			penMainFrameShortcutText.setBounds(new java.awt.Rectangle(142,90,120,23));
			penMainFrameShortcutText.addKeyListener(this);
		}
		return penMainFrameShortcutText;
	}
	

	private JTextField penMiniWindowShortcutText = null;
	private JTextField getOpenMiniWindowShortcutText() {
		if (penMiniWindowShortcutText==null) {
			penMiniWindowShortcutText = new JTextField();
			penMiniWindowShortcutText.setBounds(new java.awt.Rectangle(142,120,120,23));
			penMiniWindowShortcutText.addKeyListener(this);
		}
		return penMiniWindowShortcutText;
	}
	
	private JTextField mainFrameHeight = null;
	private JTextField getMainFrameHeight() {
		if (mainFrameHeight==null) {
			mainFrameHeight = new JTextField();
			mainFrameHeight.setBounds(new java.awt.Rectangle(200,60,45,23));
		}
		return mainFrameHeight;
	}
	
	/**
	 * This method initializes jCheckBox	
	 * 	
	 * @return javax.swing.JCheckBox	
	 */
	private JCheckBox getMinimizeFrameAfterOpenFileOrFolderEnabled() {
		if (isMinimizeFrameAfterOpenFileOrFolder == null) {
			isMinimizeFrameAfterOpenFileOrFolder = new JCheckBox();
			isMinimizeFrameAfterOpenFileOrFolder.setBounds(new java.awt.Rectangle(20,240,350,23));
			isMinimizeFrameAfterOpenFileOrFolder.setText("打开文件/文件夹之后最小化主窗口(按Shift键反向控制)");
		}
		return isMinimizeFrameAfterOpenFileOrFolder;
	}

	/**
	 * This method initializes jCheckBox	
	 * 	
	 * @return javax.swing.JCheckBox	
	 */
	private JCheckBox getAwokeConfirmCloseEnabled() {
		if (isAwokeCloseEnabled == null) {
			isAwokeCloseEnabled = new JCheckBox();
			isAwokeCloseEnabled.setBounds(new java.awt.Rectangle(20,210,350,23));
			isAwokeCloseEnabled.setText("提醒的弹出窗口可以被提前关闭");
		}
		return isAwokeCloseEnabled;
	}
	
	public boolean saveData() throws SQLException {
		String path = getUserDataPath().getText();
		if(path==null){
			path="";
		}
		if(!path.endsWith(File.separator))
			path += File.separator;			//最好以文件分隔符结尾
		DbBean dbBean = new DbBean(DbBean.DefaultPoolName);
		String sql = null;
		String val = null;
		List<String> sql_list = new ArrayList<String>();
		try {
			sql = "UPDATE "+DirectorConstants.SYS_Setting+" SET VAL='"+path + "' " +
					"Where KEY='"+DirectorConstants.Director_UserData_Path_Key+"'";
			sql_list.add(sql);

			val = getAwokeConfirmCloseEnabled().isSelected()?"1":"0";
			sql = "UPDATE "+DirectorConstants.SYS_Setting+" SET VAL='"+val + "' " +
					"Where KEY='"+DirectorConstants.Director_Reminder_AwokeCloseEnable+"'";
			sql_list.add(sql);

			//启动后最小化
			val = getMinedAfterStartup().isSelected()?"1":"0";
			sql = "UPDATE "+DirectorConstants.SYS_Setting+" SET VAL='"+val + "' " +
					"Where KEY='"+DirectorConstants.Director_MinedAfterStartup_Key+"'";
			sql_list.add(sql);

			val = getMainFrameWidth().getText();
			if (val!=null && val.trim().length()>0) {
				sql = "UPDATE "+DirectorConstants.SYS_Setting+" SET Val='"+val + "' " +
						"Where Key='"+DirectorConstants.MainFrame_Size_Width+"'";
				sql_list.add(sql);
				//adjust mainFrame size.
				this.mainFrame.setSize( Integer.valueOf(val), this.mainFrame.getSize().height);
				ComponentUtil.setLocationToCenter(this.mainFrame);
			}
			val = getMainFrameHeight().getText();
			if (val!=null && val.trim().length()>0) {
				sql = "UPDATE "+DirectorConstants.SYS_Setting+" SET Val='"+val + "' " +
						"Where Key='"+DirectorConstants.MainFrame_Size_Height+"'";
				sql_list.add(sql);	
				//adjust mainFrame size.
				this.mainFrame.setSize( this.mainFrame.getSize().width, Integer.valueOf(val));	
				ComponentUtil.setLocationToCenter(this.mainFrame);		
			}

			String hotKeyStr = this.getOpenMainFrameShortcutText().getText();
			if (hotKeyStr!=null && hotKeyStr.length()>3) {
				sql = "UPDATE "+DirectorConstants.SYS_Setting+" SET VAL='"+hotKeyStr + "' " +
						"Where KEY='"+DirectorConstants.Director_HotKey_OpenMainFrame_Key+"'";
				sql_list.add(sql);
				try{
					SystemHotKey.getInstance().registerHotKey( SystemHotKey.Key_OpenMainFrame, hotKeyStr);
				}catch(Exception e){
					e.printStackTrace();
				}
			}
			hotKeyStr = this.getOpenMiniWindowShortcutText().getText();
			if (hotKeyStr!=null && hotKeyStr.length()>3) {
				sql = "UPDATE "+DirectorConstants.SYS_Setting+" SET VAL='"+hotKeyStr + "' " +
						"Where KEY='"+DirectorConstants.Director_HotKey_OpenMiniWindow_Key+"'";
				sql_list.add(sql);
				try{
					SystemHotKey.getInstance().registerHotKey( SystemHotKey.Key_OpenMiniWindow, hotKeyStr);
				}catch(Exception e){
					e.printStackTrace();
				}
			}

			val = ComponentUtil.getSelectedItemCode(this.getAllPanelsList());
			sql = "UPDATE "+DirectorConstants.SYS_Setting+" SET VAL='"+val + "' " +
					"Where KEY='"+DirectorConstants.System_Default_Open_Panel_Key+"'";
			sql_list.add(sql);

			val = ComponentUtil.getSelectedItemCode(this.getSearchEngineList());
			sql = "UPDATE "+DirectorConstants.SYS_Setting+" SET VAL='"+val + "' " +
					"Where KEY='"+DirectorConstants.System_Default_SearchEngine_Key+"'";
			sql_list.add(sql);
			
			boolean isSelected = this.getMinimizeFrameAfterOpenFileOrFolderEnabled().isSelected();
			sql = "UPDATE "+DirectorConstants.SYS_Setting+" SET VAL='" + (isSelected?1:0) + "' " +
					"Where KEY='"+DirectorConstants.MinimizeFrame_After_OpenFileOrFolder_Key+"'";
			sql_list.add(sql);

			boolean isCloseAsMinimizeSelected = this.getCloseActionAsMinimize().isSelected();
			sql = "UPDATE "+DirectorConstants.SYS_Setting+" SET VAL='" + (isCloseAsMinimizeSelected?1:0) + "' " +
					"Where KEY='"+DirectorConstants.System_CloseAction_Key+"'";
			sql_list.add(sql);
			
			//dbBean.executeUpdate(sql);	
			dbBean.executeBatch(sql_list);
			
			//成功则更改后面值
			DirectorConstants.MinimizeFrame_After_OpenFileOrFolder_Value = isSelected?"1":"0";
			DirectorConstants.System_CloseAction_Value = isCloseAsMinimizeSelected?"1":"0";
			DirectorContext.setUserDataPath(path);		
			DirectorContext.setAwokeCloseEnabled(getAwokeConfirmCloseEnabled().isSelected());
			
			return true;
		} catch (SQLException e) {
			log.error( sql, e );
			e.printStackTrace();
			throw e;
		}
		
	}

	public boolean fetchData() throws SQLException {

		String sql="";
		Connection conn=null;
		Statement stmt=null;
		ResultSet rs=null;
		String value = null;
		try {
			DirectorCoreDao dcd = new DirectorCoreDaoImpl();
			String str_val = null;
			str_val = dcd.getInitParameterFromDatabase(DirectorConstants.System_CloseAction_Key, DirectorConstants.System_CloseAction_Minimize); //   ComponentUtil.LookAndFeel_Current ;
			DirectorConstants.System_CloseAction_Value = str_val;
			if ("1".equals(str_val)) {
				this.getCloseActionAsMinimize().setSelected(true);
			}else{
				this.getCloseActionAsClose().setSelected(true);
			}
			
			// ----------------- 
			conn= ApplicationContext.getInstance().getDataSourceManager().getConnection();
			stmt=conn.createStatement();
			
			// user data path
			sql =  "SELECT VAL FROM "+DirectorConstants.SYS_Setting +
					" Where KEY='"+DirectorConstants.Director_UserData_Path_Key+"'" ;
			rs=stmt.executeQuery(sql);
			if (rs.next()) {
				getUserDataPath().setText( rs.getString("VAL"));
			}

			// awoke button enable
			sql =  "SELECT VAL FROM "+DirectorConstants.SYS_Setting +
					" Where KEY='"+DirectorConstants.Director_Reminder_AwokeCloseEnable+"'" ;
			rs=stmt.executeQuery(sql);
			if (rs.next()) {
				String val = rs.getString("VAL");
				getAwokeConfirmCloseEnabled().setSelected("1".equals(val)?true:false);
			}
			 
			sql =  "SELECT VAL FROM "+DirectorConstants.SYS_Setting +
					" Where KEY='"+DirectorConstants.Director_MinedAfterStartup_Key+"'" ;
			rs=stmt.executeQuery(sql);
			if (rs.next()) {
				String val = rs.getString("VAL");
				getMinedAfterStartup().setSelected("1".equals(val)?true:false);
			}
			
			// mainFrame width and height
			sql =  "SELECT VAL FROM "+DirectorConstants.SYS_Setting +
					" Where KEY='"+DirectorConstants.MainFrame_Size_Width+"'" ;
			rs=stmt.executeQuery(sql);
			if (rs.next()) {
				String val = rs.getString("VAL");
				if (val!=null) {
					getMainFrameWidth().setText(val);
				}
			}
			sql =  "SELECT VAL FROM "+DirectorConstants.SYS_Setting +
					" Where KEY='"+DirectorConstants.MainFrame_Size_Height+"'" ;
			rs=stmt.executeQuery(sql);
			if (rs.next()) {
				String val = rs.getString("VAL");
				if (val!=null) {
					getMainFrameHeight().setText(val);
				}
			}

			sql =  "SELECT VAL FROM "+DirectorConstants.SYS_Setting +
					" Where KEY='"+DirectorConstants.Director_HotKey_OpenMainFrame_Key+"'" ;
			rs=stmt.executeQuery(sql);
			if (rs.next()) {
				String val = rs.getString("VAL");
				if (val!=null) {
					getOpenMainFrameShortcutText().setText(val);
				}
			}

			sql =  "SELECT VAL FROM "+DirectorConstants.SYS_Setting+" "+
					"Where KEY='"+DirectorConstants.Director_HotKey_OpenMiniWindow_Key+"'" ;
			rs=stmt.executeQuery(sql);
			if (rs.next()) {
				String val = rs.getString("VAL");
				if (val!=null) {
					getOpenMiniWindowShortcutText().setText(val);
				}
			}
			
			//默认打开面板
			value = getValueByKey(stmt, DirectorConstants.System_Default_Open_Panel_Key);
			if (value!=null) {
				ComponentUtil.setSelectedItemByCode( this.getAllPanelsList(),  value);
			}
			
			//默认web搜索引擎
			value = getValueByKey(stmt, DirectorConstants.System_Default_SearchEngine_Key);
			if (value!=null) {
				ComponentUtil.setSelectedItemByCode( this.getSearchEngineList(),  value);
			}
			
			//打开文件后是否最小化
			sql =  "SELECT VAL FROM "+DirectorConstants.SYS_Setting+" "+
					"Where KEY='"+DirectorConstants.MinimizeFrame_After_OpenFileOrFolder_Key+"'" ;
			rs=stmt.executeQuery(sql);
			if (rs.next()) {
				String val = rs.getString("VAL");
				boolean isEnable = false;
				if ("1".equals(val)) {
					isEnable = true;
				}
				this.getMinimizeFrameAfterOpenFileOrFolderEnabled().setSelected(isEnable);
				
			}
			
		} catch (SQLException e1) {
			JOptionPane.showMessageDialog(this,e1.getMessage(),"查询失败",JOptionPane.ERROR_MESSAGE);
			e1.printStackTrace();						
		} finally{
			//释放资源
			wzw.util.DbUtils.closeQuietly(conn, stmt, rs);
		}
		return true;
	}

	private String getValueByKey(Statement stmt, String key) {
		String sql =  "SELECT VAL FROM "+DirectorConstants.SYS_Setting+" "+
								"Where KEY='"+key+"'" ;
		ResultSet rs = null;
		try {
			rs=stmt.executeQuery(sql);
			if (rs.next()) {
				String val = rs.getString("VAL");
				return val;
			}
		} catch (SQLException e) {
			e.printStackTrace();
		} finally {
			DbUtils.closeQuietly(rs);
		}
		return null;
	}

	public void keyPressed(KeyEvent e) {
		int keyCode = e.getKeyCode();
		Object obj = e.getSource();
		
		//System.out.println("11111111111111--"+e.getKeyCode());
	    if ( (obj== this.getOpenMainFrameShortcutText() 
	    		||obj== this.getOpenMiniWindowShortcutText())
	    		&& keyCode!=KeyEvent.VK_CONTROL
	    		&& keyCode!=KeyEvent.VK_ALT) {
    		e.consume();
//	    	System.out.println( e.getKeyChar());
//	    	System.out.println( KeyEvent.getKeyText(keyCode));
	    	StringBuffer hotKeyStr = new StringBuffer();
	    	boolean hasFunKey = false;
	    	JTextField t_tf = (JTextField) obj;
	    	if (keyCode == KeyEvent.VK_BACK_SPACE) {
	    		t_tf.setText("");
	    		return;
			}if (e.isControlDown()) {
	    		hotKeyStr.append( " Ctrl +") ;
	    		hasFunKey = true;
			}
	    	if (e.isAltDown()) {
	    		hotKeyStr.append( " Alt +") ;
	    		hasFunKey = true;
			}
	    	if (hasFunKey == false) { //如果没有按功能键，默认Ctrl+Alt
	    		hotKeyStr.append( " Ctrl + Alt +") ;
			}else{
				hotKeyStr.append(" ")
    					.append( KeyEvent.getKeyText(keyCode).toUpperCase() ) ;
			}
			System.out.println(hotKeyStr);
			t_tf.setText(hotKeyStr.toString().trim());
    		
	    }
	}

	public void keyReleased(KeyEvent e) {
		// TODO Auto-generated method stub
		
	}

	public void keyTyped(KeyEvent e) {
		// TODO Auto-generated method stub
		
	}

}  //  @jve:decl-index=0:visual-constraint="10,10"
